import {createRouter,createWebHistory}from 'vue-router'

import LoginVue from '../views/Login.vue'
import LayoutVue from '../views/Layout.vue'
import UserInfoVue from '../views/user/UserInfo.vue'
import HomeVue from '../views/Home.vue'
import UserInfoChangeVue from '../views/user/UserInfoUpdate.vue'
import UserAvatarUpdateVue from '../views/user/UserAvatarUpdate.vue'
import UserResetPasswordVue from '../views/user/UserResetPassword.vue'
import RechargeRecordsVue from '../views/recharge/RechargeRecords.vue'
import UtilityBillInfoVue from '../views/utilitybill/UtilityBillInfo.vue'
import AnnouncementVue from '../views/announcement/Announcements.vue'
import UserManagement1Vue from '../views/admin/UserManagement.vue'
import CServiceVue from '@/views/cs/CService.vue'
import TieredPayment from '@/views/utilitybill/TieredPayment.vue'
import ChatVue from '@/views/cs/Chat.vue'
import LobbyVue from '@/views/cs/TestLobby.vue'

const routes=[
    {path:'/login',component:LoginVue},
    {
        path:'/',
        component:LayoutVue,redirect:'/user/info',children:[
            {path:'/home',component:HomeVue},
            {path:'/user/info',component:UserInfoVue},
            {path:'/user/info?adon=${adon}',component:UserInfoVue},
            {path:'/user/info',component:UserInfoVue,children:[
                    {path:'/user/info/update',component:UserInfoChangeVue},
                    {path:'/user/avatarupdate',component:UserAvatarUpdateVue},
                    {path:'/user/resetpassword',component:UserResetPasswordVue}
                ]},

            {path:'/recharge/records',component:RechargeRecordsVue},
            {path:'/utility/billinfo',component:UtilityBillInfoVue},
            {path:'/utility/tieredpayment',component:TieredPayment},
            {path:'/announcement',component: AnnouncementVue},
            {path:'/announcement?p=${p}',component: AnnouncementVue},
            {path:'/usermanagement',component:UserManagement1Vue},
            {path:'/cservice',component:LobbyVue},
            {path:'/cservice?p=${p}',component:LobbyVue, children:[
                {path:'/cservice/chat',name:'Chat', component:ChatVue},
                {path:'/cservice/chat?sessionid=${sessionid}', component:ChatVue }

            ]}

        ]
    }]
const router=createRouter({
    history:createWebHistory(),
    routes:routes,

});

export  default router